Telegram Group & Telegram Channel
🧠 RegExp: Как найти строки с IP-адресами в логах

Частая задача — выцепить IP-адреса из логов. Вот регулярка и однострочник, которые помогут:


grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' /var/log/nginx/access.log


📌 Что делает:
- -Eo — включаем расширенные регулярки и выводим только совпадения
- ([0-9]{1,3}\.){3}[0-9]{1,3} — шаблон для IPv4-адресов

💡 Можно дополнительно убрать дубликаты и отсортировать по частоте:


grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' /var/log/nginx/access.log | sort | uniq -c | sort -nr | head


🚀 Покажет топ IP-адресов по количеству обращений — удобно для анализа трафика и выявления подозрительной активности.



tg-me.com/pro_python_code/1799
Create:
Last Update:

🧠 RegExp: Как найти строки с IP-адресами в логах

Частая задача — выцепить IP-адреса из логов. Вот регулярка и однострочник, которые помогут:


grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' /var/log/nginx/access.log


📌 Что делает:
- -Eo — включаем расширенные регулярки и выводим только совпадения
- ([0-9]{1,3}\.){3}[0-9]{1,3} — шаблон для IPv4-адресов

💡 Можно дополнительно убрать дубликаты и отсортировать по частоте:


grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' /var/log/nginx/access.log | sort | uniq -c | sort -nr | head


🚀 Покажет топ IP-адресов по количеству обращений — удобно для анализа трафика и выявления подозрительной активности.

BY Python RU




Share with your friend now:
tg-me.com/pro_python_code/1799

View MORE
Open in Telegram


Python RU Telegram | DID YOU KNOW?

Date: |

How to Invest in Bitcoin?

Like a stock, you can buy and hold Bitcoin as an investment. You can even now do so in special retirement accounts called Bitcoin IRAs. No matter where you choose to hold your Bitcoin, people’s philosophies on how to invest it vary: Some buy and hold long term, some buy and aim to sell after a price rally, and others bet on its price decreasing. Bitcoin’s price over time has experienced big price swings, going as low as $5,165 and as high as $28,990 in 2020 alone. “I think in some places, people might be using Bitcoin to pay for things, but the truth is that it’s an asset that looks like it’s going to be increasing in value relatively quickly for some time,” Marquez says. “So why would you sell something that’s going to be worth so much more next year than it is today? The majority of people that hold it are long-term investors.”

A Telegram spokesman declined to comment on the bond issue or the amount of the debt the company has due. The spokesman said Telegram’s equipment and bandwidth costs are growing because it has consistently posted more than 40% year-to-year growth in users.

Python RU from ye


Telegram Python RU
FROM USA